/*
 * action_utils.h
 */

#ifndef ACTION_UTILS_H_
#define ACTION_UTILS_H_

#include <controller/action.h>
#include <controller/event.h>
#include <controller/listener.h>
#include <agent/unit.h>

/*
 * Moves the unit described in the given event by the given x/y values described
 * in the given event.
 */
event * move_unit( action *a );

/*
 * Damages the unit described in the given event by the given amount described
 * in the given event. Being damaged can cause the following status effects:
 * -Dead
 * -Scare
 * -Bleeding
 */
event * damage_unit( action *a );

/*
 * Bleeds the unit described in the given event by the given amount described,
 * dealing damage. If the damage is high enough, will create a new bleed event
 * for less damage and queue it in the timed controller
 */
event * bleed_unit( action *a );

/*
 * Causes the first unit described to attack the second, dealing the given
 * amount of damage.
 */
event * attack_unit( action *a );

/*
 * Creates a new move action, removing the need to create an event directly.
 */
action* create_move_action( event_t type, unit *u, long x, long y );

/*
 * Creates a new damage action, removing the need to create an event directly.
 */
action* create_damage_action( event_t type, unit *u, int amount );

/*
 * Creates a new bleed action, removing the need to create an event directly.
 */
action* create_bleed_action( event_t type, unit *u, int amount );

/*
 * Creates a new attack action, removing the need to create an event directly.
 */
action* create_attack_action( event_t type, unit *attacker, unit *victim, int amount );

#endif
